package com.xy.shop.web.service.impl;

import com.xy.shop.web.dao.BaseParamMapper;
import com.xy.shop.web.dto.BaseParam;
import com.xy.shop.web.service.BaseParamService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @ClassName BaseParamServiceImpl
 * @Description : 功能说明 参数配置
 * @Param:
 * @Return :
 * @Author : zyy
 * @Date : 2baseParamMapper2baseParamMapper/6/25 23:baseParamMapper9
*/
@Service
public class BaseParamServiceImpl implements BaseParamService {
    @Resource
    private BaseParamMapper baseParamMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return baseParamMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(BaseParam record) {
        return baseParamMapper.insert(record);
    }

    @Override
    public int insertSelective(BaseParam record) {
        return baseParamMapper.insertSelective(record);
    }

    @Override
    public BaseParam selectByPrimaryKey(Integer id) {
        return baseParamMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(BaseParam record) {
        return baseParamMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(BaseParam record) {
        return baseParamMapper.updateByPrimaryKey(record);
    }

    @Override
    public String selectByPrimarycode(String code) {
        BaseParam baseParam=  baseParamMapper.selectByPrimarycode(code);
        if(Objects.nonNull(baseParam)) {
            return baseParam.getValue();
        }
        return null;
    }

    @Override
    public List<BaseParam> queryListByPage(Map<String, Object> parameter) {
        return baseParamMapper.queryListByPage(parameter);
    }
}
